﻿


Public Class ListaItems
    Dim lista As New List(Of Item)
    Sub agregar(ByVal valor As String, ByVal etiqueta As String)
        lista.Add(New Item(valor, etiqueta))
    End Sub

    Public Function getIndiceItemByValor(ByVal valor As String) As Integer
        Dim i = 0
        For Each it As Item In lista
            If it.valor = valor Then
                Return i
            End If
            i = i + 1
        Next

        Return -1
    End Function

    Public Function toArray() As Object()
        Return lista.ToArray()
    End Function

End Class
